package designMode.factory;

public class Test {
	public static void main(String[] args) {
		AbstractFactory af = new AbstractFactory() {

			@Override
			public mainBoard createMainBoard() {
				return new mainBoard() {

					@Override
					public void run() {
						System.out.println("��˶����");
					}
				};
			}

			@Override
			public graCard createGraCard() {
				return new graCard() {

					@Override
					public void show() {
						System.out.println("�߲ʺ��Կ�");
					}
				};
			}

			@Override
			public cpu createCpu() {
				return new cpu() {

					@Override
					public void work() {
						System.out.println("Ӣ�ض�cpu");
					}
				};
			}
		};
		af.createMainBoard().run();
		af.createCpu().work();
		af.createGraCard().show();
		AbstractFactory newaf=new Xianka() {

			@Override
			public graCard createGraCard() {
				return new graCard() {

					@Override
					public void show() {
						System.out.println("amd�Կ�");
					}
				};
			}
		};
		newaf.createGraCard().show();
	}
}
